import pyttsx3

# 创建一个 Text-to-Speech 引擎
engine = pyttsx3.init()

# 设置要转换成语音的文本内容
text = "Hello, how are you today?"





def speak(text):
    # 将文本转换成语音并播放
    engine.say(text)
    engine.runAndWait()



if __name__ == '__main__':
    speak(text)